import {
    createSlice
} from '@reduxjs/toolkit';

const initial = {
    value: null
};

export const userSlice = createSlice({
    name: 'user',
    initialState: initial,
    reducers: {
        addUserInfo: (state, action) => {
            state.value = action.payload;
        }
    }
});

export const getUserInfo = state => {
    console.log(state);
    return state.user.value;
};

export const {
    addUserInfo,
} = userSlice.actions;

export default userSlice.reducer;